import { createDecorator } from 'vue-class-component'
import { debounce } from 'lodash'

export function Debounce(delay:number | undefined = 300) {
  return createDecorator((options: any, key) => {
    options.methods[key] = debounce(options.methods[key], delay);
  })
}